<div class="header">
  <back-Btn></back-Btn>
  项目付款
</div>
<div class="container finance">
  <div class="list f_sk">
    <div class="list-item icon_more required" ng-click="chooseProject()">
      <div class="item-label">项目名称</div>
      <div class="flow-content">{{ param.projectName }}</div>
    </div>
    <div class="list-item list-item-textarea required">
      <div class="item-label">付款事由</div>
      <div class="flow-content">
        <textarea cols="30" rows="10" ng-model="param.payReason"></textarea>
      </div>
    </div>

    <div class="list-item list-item-textarea">
      <div class="item-label">备注</div>
      <div class="flow-content">
        <textarea cols="30" rows="10" ng-model="param.remark"></textarea>
      </div>
    </div>
    <!-- 自定义字段 -->
    <div user-defined field-map="param.fieldMap" validation="validation" uid="param.uid"
      processid="param.processInstanceId"></div>
    <div class="list table-list">
      <div class="info-title">
        扣款明细
        <span class="c-blue fr" ng-click="showCertificate()">添加</span>
      </div>

      <div class="table-item" ng-repeat="item in param.deductList">
        <div class="content" ng-class="{cur:$index==costindex}" ng-click="resetlist(0)" ng-swipe-left="swipe($index,0)"
          ng-swipe-right="swipe(-1,0)">
          <div class="list-item icon_more">
            <div class="item-label">款项类别</div>
            <div class="flow-content">
              {{ item.deductType | getnamefromvalue }}
            </div>
          </div>
          <div class="list-item icon_more">
            <div class="item-label">款项小类</div>
            <div class="flow-content">{{ item.deductName }}</div>
          </div>
          <div class="list-item">
            <div class="item-label">扣款金额</div>
            <div class="flow-content">{{ item.deductAmount }}</div>
          </div>
          <div class="list-item">
            <div class="item-label">扣款事由</div>
            <div class="flow-content">{{ item.deductRemark }}</div>
          </div>
          <div class="file-upload" file-list file-data="item.deductAttachment"></div>
        </div>
        <div class="delete_icon icon_del" ng-click="deletedItem($index)"></div>
      </div>
    </div>
    <div class="list table-list">
      <div class="info-title">
        付款明细 <span class="c-blue fr" ng-click="showPayment()">添加</span>
      </div>
      <div class="table-item">
        <div class="list-item icon_more" ng-click="chooseSk()">
          <div class="item-label">项目收款</div>
          <div class="flow-content">
            {{ param.gatheringNo }}
          </div>
        </div>
        <div class="list-item required">
          <div class="item-label">付款金额</div>
          <div class="flow-content">
            <input type="text" ng-model="param.acceptAmount" tel-directive />
          </div>
        </div>
        <div class="list-item required icon_more">
          <div class="item-label">工程款大类</div>
          <label class="flow-content">
            <select ng-model="param.payType1" ng-options="item.value as item.key for item in gckTypeList"
              ng-change="payTypechange()">
            </select>
          </label>
        </div>
        <div class="list-item required icon_more">
          <div class="item-label">工程款小类</div>
          <label class="flow-content">
            <select ng-model="param.payType2" ng-options="item.value as item.key for item in gckTypeListA">
            </select>
          </label>
        </div>
        <div class="list-item icon_more required">
          <div class="item-label">收款人</div>
          <div class="flow-content">
            <input type="text" ng-model="param.acceptPerson" />
            <p class="project_name" ng-click="showSearchPicker()"></p>
          </div>
        </div>
        <div class="list-item required">
          <div class="item-label">收款人账号</div>
          <div class="flow-content">
            <input type="text" ng-model="param.acceptAccount" />
          </div>
        </div>
        <div class="list-item required">
          <div class="item-label">收款人开户行</div>
          <div class="flow-content">
            <input type="text" ng-model="param.acceptBank" />
          </div>
        </div>
        <div class="list-item icon_more">
          <div class="item-label">发票类型</div>
          <label class="flow-content">
            <select ng-model="param.invoiceType" ng-options="item.value as item.key for item in invoiceTypeList"
              ng-change="invoiceTypechange()">
            </select>
          </label>
        </div>
        <div class="list-item required icon_more" ng-show="param.invoiceType" ng-click="chooseInvoice()">
          <div class="item-label">发票编号</div>
          <div class="flow-content">{{param.paymentInvoiceNo}}</div>
        </div>
        <div class="list-item icon_more">
          <div class="item-label">合同类型</div>
          <label class="flow-content">
            <select ng-model="param.contractType" ng-options="item.value as item.key for item in contractTypeList"
              ng-change="contractTypechange()">
            </select>
          </label>
        </div>
        <div class="list-item required icon_more" ng-show="param.contractType" ng-click="chooseContract()">
          <div class="item-label">合同编号</div>
          <div class="flow-content">
            {{param.commonContractNo}}
          </div>
        </div>
        <div class="list-item">
          <div class="item-label">付款事由</div>
          <div class="flow-content">
            <input type="text" ng-model="param.payRemark" />
          </div>
        </div>
        <div class="list-item">
          <div class="item-label">备注</div>
          <div class="flow-content">
            <input type="text" ng-model="param.notes" />
          </div>
        </div>
        <span ng-show="param.invoices&&param.invoices.length>0">
          <div class="info-title">开票明细</div>
          <div class="table-item" ng-repeat="item in param.invoices track by $index"
            style="margin: 5px 10px 0;border: 1px solid #eee;border-radius: 5px;">
            <div class="list-item">
              <div class="item-label">发票编号</div>
              <div class="flow-content" relative-module="Xm_InputInvoice" module-no="{{ item.invoiceNo }}">
                {{ item.invoiceNo }}</div>
            </div>
            <div class="list-item">
              <div class="item-label">本次开票金额</div>
              <div class="flow-content">{{ item.coverAmount|NBFmt }}</div>
            </div>
          </div>
        </span>
      </div>
      <!-- 列表 -->
      <div class="table-item" ng-repeat="item in param.paymentList">
        <div class="content" ng-class="{cur:$index==payindex}" ng-click="resetlist(1)" ng-swipe-left="swipe($index,1)"
          ng-swipe-right="swipe(-1,1)">
          <div class="list-item">
            <div class="item-label">项目收款</div>
            <div class="flow-content">
              {{ item.gatheringNo }}
            </div>
          </div>
          <div class="list-item">
            <div class="item-label">付款金额</div>
            <div class="flow-content">{{ item.acceptAmount }}</div>
          </div>
          <div class="list-item">
            <div class="item-label">工程款大类</div>
            <div class="flow-content">{{ item.payType1 }}</div>
          </div>
          <div class="list-item">
            <div class="item-label">工程款小类</div>
            <div class="flow-content">{{ item.payType2 }}</div>
          </div>
          <div class="list-item">
            <div class="item-label">收款人</div>
            <div class="flow-content">{{ item.acceptPerson }}</div>
          </div>
          <div class="list-item">
            <div class="item-label">收款人账号</div>
            <div class="flow-content">{{ item.acceptAccount }}</div>
          </div>
          <div class="list-item">
            <div class="item-label">收款人开户行</div>
            <div class="flow-content">{{ item.acceptBank }}</div>
          </div>
          <div class="list-item" ng-show="item.invoiceType">
            <div class="item-label">发票类别</div>
            <div class="flow-content"><select ng-model="item.invoiceType"
                ng-options="item.value as item.key for item in invoiceTypeList" disabled>
              </select></div>
          </div>
          <div class="list-item" ng-show="item.paymentInvoiceNo">
            <div class="item-label">发票编号</div>
            <div class="flow-content">{{ item.paymentInvoiceNo }}</div>
          </div>
          <div class="list-item" ng-show="item.contractType">
            <div class="item-label">合同类别</div>
            <div class="flow-content"><select ng-model="item.contractType"
                ng-options="item.value as item.key for item in contractTypeList" disabled>
              </select></div>
          </div>
          <div class="list-item" ng-show="item.commonContractNo">
            <div class="item-label">合同编号</div>
            <div class="flow-content" relative-module="{{item.contractType}}" module-no="{{ item.commonContractNo }}">
              {{ item.commonContractNo }}
            </div>
          </div>
          <div class="list-item" ng-show="item.payRemark">
            <div class="item-label">付款事由</div>
            <div class="flow-content">{{ item.payRemark }}</div>
          </div>
          <div class="list-item" ng-show="item.notes">
            <div class="item-label">备注</div>
            <div class="flow-content">{{ item.notes }}</div>
          </div>
          <span ng-show="item.invoices&&item.invoices.length>0">
            <div class="info-title">开票明细</div>
            <div class="table-item" ng-repeat="subitem in item.invoices track by $index"
              style="margin: 5px 10px 0;border: 1px solid #eee;border-radius: 5px;">
              <div class="list-item">
                <div class="item-label">发票编号</div>
                <div class="flow-content" relative-module="Xm_InputInvoice" module-no="{{ subitem.invoiceNo }}">
                  {{ subitem.invoiceNo }}</div>
              </div>
              <div class="list-item">
                <div class="item-label">本次开票金额</div>
                <div class="flow-content">{{ subitem.coverAmount|NBFmt }}</div>
              </div>
            </div>
          </span>
        </div>
        <div class="delete_icon icon_del" ng-click="deletePayItem($index)"></div>
      </div>
    </div>
    <!-- 附件 -->
    <div class="file-upload" file-upload file-data="param.attachment"></div>
    <!-- 审查日志 -->
    <div log-list taskid="process_id"></div>
  </div>
</div>
<!-- 删除流程 -->
<div delete-flow uid="param.uid" id="{{ param.processInstanceId }}" submit="submit" validate="validate"></div>
<!-- 扣款明细 -->
<div class="list tablestyle pickceritem" ng-show="showCerPicker">
  <div class="list-item f_sk">
    <div class="grid list-content icon_enter required">
      <div class="col-1-4">款项类别</div>
      <div class="col-3-4">
        <select name="sex" id="sexSelect" ng-model="picker.deductType" ng-change="costTypechange()"
          ng-options="item.value as item.key for item in costTypeList">
          <option value="">选择款项类型</option>
        </select>
      </div>
    </div>
    <div class="grid list-content icon_enter">
      <div class="col-1-4">款项小类</div>
      <div class="col-3-4">
        <select ng-model="picker.deductName" ng-options="item.value as item.key for item in costsubTypeList">
        </select>
      </div>
    </div>
    <div class="grid list-content required">
      <div class="col-1-4">扣款金额</div>
      <div class="col-3-4">
        <input type="text" tel-directive ng-model="picker.deductAmount" />
      </div>
    </div>
    <div class="grid list-content required">
      <div class="col-1-4">扣款事由</div>
      <div class="col-3-4">
        <input type="text" ng-model="picker.deductRemark" />
      </div>
    </div>
    <div class="file-upload" file-upload file-data="picker.deductAttachment" maxnum="1"></div>
  </div>
  <div class="pickceritem-btn tc flex">
    <div class="cancel" ng-click="closePicker()">取消</div>
    <div class="confirm" ng-click="addCertificate()">确定</div>
  </div>
</div>
<!-- 付款明细 -->
<div class="list tablestyle pickceritem" ng-show="showPayPicker">
  <div class="list-item">
    <div class="grid list-content icon_enter" ng-click="chooseSk()">
      <div class="col-1-4">项目收款</div>
      <div class="col-3-4">
        {{ payPicker.gatheringNo }}
      </div>
    </div>
    <div class="grid list-content required">
      <div class="col-1-4">付款金额</div>
      <div class="col-3-4">
        <input type="text" ng-model="payPicker.acceptAmount" tel-directive />
      </div>
    </div>
    <div class="grid list-content required icon_enter">
      <div class="col-1-4">工程款大类</div>
      <label class="col-3-4">
        <select ng-model="payPicker.payType1" ng-options="item.value as item.key for item in gckTypeList"
          ng-change="payTypechange2()">
        </select>
      </label>
    </div>
    <div class="grid list-content required icon_enter">
      <div class="col-1-4">工程款小类</div>
      <label class="col-3-4">
        <select ng-model="payPicker.payType2" ng-options="item.value as item.key for item in gcksubTypeList">
        </select>
      </label>
    </div>
    <div class="grid list-content required">
      <div class="col-1-4">收款人</div>
      <div class="col-3-4">
        <input type="text" ng-model="payPicker.acceptPerson" />
      </div>
    </div>
    <div class="grid list-content required">
      <div class="col-1-4">收款人账号</div>
      <div class="col-3-4">
        <input type="text" ng-model="payPicker.acceptAccount" />
      </div>
    </div>
    <div class="grid list-content required">
      <div class="col-1-4">收款人开户行</div>
      <div class="col-3-4">
        <input type="text" ng-model="payPicker.acceptBank" />
      </div>
    </div>
    <div class="grid list-content icon_more">
      <div class="col-1-4">发票类型</div>
      <label class="col-3-4">
        <select ng-model="payPicker.invoiceType" ng-options="item.value as item.key for item in invoiceTypeList"
          ng-change="invoiceTypechange1()">
        </select>
      </label>
    </div>
    <div class="grid list-content required icon_more" ng-show="payPicker.invoiceType" ng-click="chooseInvoice1()">
      <div class="col-1-4">发票编号</div>
      <div class="col-3-4">
        {{ payPicker.paymentInvoiceNo }}
      </div>
    </div>
    <div class="grid list-content icon_more">
      <div class="col-1-4">合同类型</div>
      <label class="col-3-4">
        <select ng-model="payPicker.contractType" ng-options="item.value as item.key for item in contractTypeList"
          ng-change="contractTypechange1()">
        </select>
      </label>
    </div>
    <div class="grid list-content required icon_more" ng-show="payPicker.contractType" ng-click="chooseContract1()">
      <div class="col-1-4">合同编号</div>
      <div class="col-3-4">
        {{ payPicker.commonContractNo }}
      </div>
    </div>
    <div class="grid list-content">
      <div class="col-1-4">付款事由</div>
      <div class="col-3-4">
        <input type="text" ng-model="payPicker.payRemark" />
      </div>
    </div>
    <div class="grid list-content">
      <div class="col-1-4">备注</div>
      <div class="col-3-4">
        <input type="text" ng-model="payPicker.notes" />
      </div>
    </div>
  </div>
  <div class="pickceritem-btn tc flex">
    <div class="cancel" ng-click="closePicker()">取消</div>
    <div class="confirm" ng-click="addPayItem()">确定</div>
  </div>
</div>
<div search-input show-search-input="showSearchInput" apiurl="apiurl" handle-search="handleSearch" param="searchparam"
  title="searchtitle"></div>